home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 June / MacFormat 25.iso / Shareware City / Developers / ICAppSourceKit1.0 / IconFamilies.p < prev    next >
Encoding:
Text File  |  1994-09-22  |  4.7 KB  |  179 lines  |  [TEXT/PJMM]

  1. unit IconFamilies;
  2.  
  3. {  Source:    Macintosh Technical Note #306 by Jim Mensch and David Collins }
  4. {     Definitions to deal with icon families under System 7 and later }
  5.  
  6. interface
  7.  
  8. {$IFC undefined THINK_Pascal}
  9.     uses
  10.         Memory, QuickDraw, Types;
  11. {$ENDC}
  12.  
  13.     const
  14.         Large1BitMask = 'ICN#';
  15.         Large4BitData = 'icl4';
  16.         Large8BitData = 'icl8';
  17.         Small1BitMask = 'ics#';
  18.         Small4BitData = 'ics4';
  19.         Small8BitData = 'ics8';
  20.         Mini1BitMask = 'sicn';
  21.         Mini4BitData = 'icm4';
  22.         Mini8BitData = 'icm8';
  23.  
  24.     const
  25.         ttNone = $0000;
  26.         ttDisabled = $0001;
  27.         ttOffline = $0002;
  28.         ttOpen = $0003;
  29.         ttSelected = $4000;
  30.         ttSelectedDisabled = (ttSelected + ttDisabled);
  31.         ttSelectedOffline = (ttSelected + ttOffline);
  32.         ttSelectedOpen = (ttSelected + ttOpen);
  33.  
  34.     const
  35.         ttLabel0 = $0000;
  36.         ttLabel1 = $0100;
  37.         ttLabel2 = $0200;
  38.         ttLabel3 = $0300;
  39.         ttLabel4 = $0400;
  40.         ttLabel5 = $0500;
  41.         ttLabel6 = $0600;
  42.         ttLabel7 = $0700;
  43.  
  44.     const
  45.         atNone = $0000;
  46.         atVerticalCenter = $0001;
  47.         atTop = $0002;
  48.         atBottom = $0003;
  49.         atHorizontalCenter = $0004;
  50.         atLeft = $0008;
  51.         atRight = $000C;
  52.  
  53.     const
  54.         svLarge1Bit = $00000001;
  55.         svLarge4Bit = $00000002;
  56.         svLarge8Bit = $00000004;
  57.         svSmall1Bit = $00000100;
  58.         svSmall4Bit = $00000200;
  59.         svSmall8Bit = $00000400;
  60.         svMini1Bit = $00010000;
  61.         svMini4Bit = $00020000;
  62.         svMini8Bit = $00040000;
  63.         svAllLargeData = $000000ff;
  64.         svAllSmallData = $0000ff00;
  65.         svAllMiniData = $00ff0000;
  66.         svAll1BitData = (svLarge1Bit + svSmall1Bit + svMini1Bit);
  67.         svAll4BitData = (svLarge4Bit + svSmall4Bit + svMini4Bit);
  68.         svAll8BitData = (svLarge8Bit + svSmall8Bit + svMini8Bit);
  69.         svAllAvailableData = $ffffffff;
  70.  
  71.  
  72.     function PlotIconID (var theRect: rect; align, transform, theResID: integer): OSErr;
  73.     inline
  74.         $303C, $0500, $ABC9;
  75.  
  76.     function NewIconSuite (var theIconSuite: handle): OSErr;
  77.     inline
  78.         $303C, $0207, $ABC9;
  79.  
  80.     function AddIconToSuite (theIconData, theSuite: handle; theType: ResType): OSErr;
  81.     inline
  82.         $303C, $0608, $ABC9;
  83.  
  84.     function GetIconFromSuite (var theIconData: handle; theSuite: handle; theType: ResType): OSErr;
  85.     inline
  86.         $303C, $0609, $ABC9;
  87.  
  88.     function ForEachIconDo (theSuite: handle; selector: longInt; action: ProcPtr; yourDataPtr: ptr): OSErr;
  89.     inline
  90.         $303C, $080A, $ABC9;
  91.  
  92.     function GetIconSuite (var theIconSuite: handle; theResID: integer; selector: longInt): OSErr;
  93.     inline
  94.         $303C, $0501, $ABC9;
  95.  
  96.     function DisposeIconSuite (theIconSuite: handle; disposeData: boolean): OSErr;
  97.     inline
  98.         $303C, $0302, $ABC9;
  99.  
  100.     function PlotIconSuite (var theRect: rect; align, transform: integer; theIconSuite: Handle): OSErr;
  101.     inline
  102.         $303C, $0603, $ABC9;
  103.  
  104.     function MakeIconCache (var theHandle: Handle; makeIcon: ProcPtr; yourDataPtr: ptr): OSErr;
  105.     inline
  106.         $303C, $0604, $ABC9;
  107.  
  108.     function LoadIconCache (var theRect: rect; align, transform: integer; theIconCache: Handle): OSErr;
  109.     inline
  110.         $303C, $0606, $ABC9;
  111.  
  112.     function GetLabel (labelNumber: integer; var labelColor: RGBColor; var labelString: Str255): OSErr;
  113.     inline
  114.         $303c, $050B, $ABC9;
  115.  
  116.     function PtInIconID (testPt: Point; var iconRect: Rect; alignment, iconID: integer): Boolean;
  117.     inline
  118.         $303c, $060D, $ABC9;
  119.  
  120.     function PtInIconSuite (testPt: Point; var iconRect: Rect; alignment: integer; theIconSuite: Handle): Boolean;
  121.     inline
  122.         $303c, $070E, $ABC9;
  123.  
  124.     function RectInIconID (var testRect, iconRect: rect; alignment, iconID: integer): Boolean;
  125.     inline
  126.         $303c, $0610, $ABC9;
  127.  
  128.     function RectInIconSuite (var testRect, iconRect: rect; alignment: integer; theIconSuite: Handle): Boolean;
  129.     inline
  130.         $303c, $0711, $ABC9;
  131.  
  132.     function IconIDToRgn (theRgn: RgnHandle; var iconRect: Rect; alignment, iconID: integer): OSErr;
  133.     inline
  134.         $303c, $0613, $ABC9;
  135.  
  136.     function IconSuiteToRgn (theRgn: RgnHandle; var iconRect: Rect; alignment: integer; theIconSuite: Handle): OSErr;
  137.     inline
  138.         $303c, $0714, $ABC9;
  139.  
  140.     function SetSuiteLabel (theSuite: Handle; theLabel: integer): OSErr;
  141.     inline
  142.         $303C, $0316, $ABC9;
  143.  
  144.     function GetSuiteLabel (theSuite: Handle): integer;
  145.     inline
  146.         $303C, $0217, $ABC9;
  147.  
  148.     function GetIconCacheData (theCache: Handle; var theData: ptr): OSErr;
  149.     inline
  150.         $303C, $0419, $ABC9;
  151.  
  152.     function SetIconCacheData (theCache: Handle; theData: ptr): OSErr;
  153.     inline
  154.         $303C, $041A, $ABC9;
  155.  
  156.     function GetIconCacheProc (theCache: Handle; var theProc: ProcPtr): OSErr;
  157.     inline
  158.         $303C, $041B, $ABC9;
  159.  
  160.     function SetIconCacheProc (theCache: Handle; theProc: ProcPtr): OSErr;
  161.     inline
  162.         $303C, $041C, $ABC9;
  163.  
  164.     function PlotSICNHandle (var theRect: rect; align, transform: integer; theSICN: Handle): OSErr;
  165.     inline
  166.         $303C, $061E, $ABC9;
  167.  
  168.     function PlotCIconHandle (var theRect: rect; align, transform: integer; theCIcon: CIconHandle): OSErr;
  169.     inline
  170.         $303C, $061F, $ABC9;
  171.  
  172.     function SetLabel (labelNumber: integer; var labelColor: RGBColor; var labelString: Str255): OSErr;
  173.     inline
  174.         $303C, $050C, $ABC9;
  175.  
  176. implementation
  177.  
  178. end.
  179.